package com.huanlis.cloud.utils;

/**
 * @author lihuan
 * @since 2023/10/18 15:39:19
 */
public enum RCodeEnum {

    // 请求成功
    SUCCESS(true, 2000, "请求成功"),
    HTTP_CLIENT_ERROR(false, 4000, "请求失败"),
    UNAUTHORIZED_ERROR(false, 4001, "无访问权限"),
    /**
     * 密码或用户名错误 code:4002
     */
    NAME_OR_PWD_ERROR(false, 4002, "密码或用户名错误"),
    NO_USER(false, 4003, "该用户未注册"),
    NULL_POINT_ERROR(false, 5002, "空指针异常"),
    RESOURCE_ERROR(false, 5003, "内部资源错误"),
    UNKNOWN_ERROR(false, 4004, "未知错误");

    /**
     * 响应是否成功
     */
    private final Boolean success;
    /**
     * 响应状态码
     */
    private final Integer code;
    /**
     * 响应信息
     */
    private final String message;

    RCodeEnum(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public Boolean getSuccess() {
        return success;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
